/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.manager;

import java.io.IOException;
import ru.jSkyRoom.interfaces.JSkyMod;
import skyproc.GRUP_TYPE;
import skyproc.ModListing;
import skyproc.SPImporter;
import skyproc.exceptions.BadMod;
import skyproc.exceptions.MissingMaster;

/**
 *
 * @author Rakev
 */
public class ModImporter {

    private static ModImporter instance = new ModImporter();

    public static ModImporter getInstance() {
        return instance;
    }

    private ModImporter() {
    }

    public JSkyMod importMod(String modName, GRUP_TYPE... grupTargets) throws BadMod, MissingMaster {
        ModListing importingMod = new ModListing(modName);
        SPImporter.importMod(importingMod, grupTargets);
        return ModManager.getInstance().findMod(modName);
    }

    public void importActiveMods(GRUP_TYPE... grupTargets) throws IOException, MissingMaster {
        SPImporter.importActiveMods(grupTargets);
    }

    public void importAllMods(GRUP_TYPE... grupTargets) throws IOException, MissingMaster {
        SPImporter.importAllMods(grupTargets);
    }
}
